package com.ttg.web.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.model.mapper.SysConfigMapper;
import com.ttg.model.pojo.SysConfig;
import com.ttg.web.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Objects;


@Slf4j
@Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService {

    @Override
    public SysConfig getSysConfig(String sysName) {
        LambdaQueryWrapper<SysConfig> lambdaQueryWrapper=new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(SysConfig::getSysName,sysName);
        SysConfig sysConfig=getOne(lambdaQueryWrapper);
        if(Objects.isNull(sysConfig)){
            return  null;
        }
        return  sysConfig;
    }
}
